#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
ll s;
int w[N], v[N];
int l[N], r[N];
int cnt[N];
ll sum[N];
ll f(int x) {
  rep(i, 1, n) {
    cnt[i] = cnt[i - 1] + (w[i] >= x);
    sum[i] = sum[i - 1] + (w[i] >= x) * v[i];
  }
  ll res = 0;
  rep(i, 1, m) {
    res += (cnt[r[i]] - cnt[l[i] - 1]) * (sum[r[i]] - sum[l[i] - 1]);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> s;
  rep(i, 1, n) cin >> w[i] >> v[i];
  rep(i, 1, m) cin >> l[i] >> r[i];
  int x1 = 1, x2 = 1e6;
  ll f1 = f(x1), f2 = f(x2);
  if (f1 <= s) {  // f2 < s && f1 <= s
    cout << s - f1;
    return 0;
  }
  while (x2 - x1 >= 2) {
    int mid = (x1 + x2) >> 1;
    ll fmid = f(mid);
    if (fmid >= s) {
      x1 = mid;
      f1 = fmid;
    } else {
      x2 = mid;
      f2 = fmid;
    }
  }
  cout << min(f1 - s, s - f2);
  return 0;
}